package com.qfedu.hotelssm.controller;

import com.qfedu.hotelssm.entity.Rooms;
import com.qfedu.hotelssm.service.intf.RoomsService;
import com.qfedu.hotelssm.vo.PageBean;
import com.qfedu.hotelssm.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author mk
 * @date 2022/8/28  21:12
 */
@RestController
@RequestMapping("/api/rooms/")
public class RoomsController {
    @Autowired
    private RoomsService service;
    //修改
    @PostMapping("update.do")
    public R update(Rooms rooms){
        return service.update(rooms);
    }

    //查询
    @GetMapping("page.do")
    public PageBean page(String name, int page, int limit){
        return service.selectPage(name, page, limit);
    }
    //查询客房入住情况
    @GetMapping("roomstatustj.do")
    public R roomstatusTj(){
        return service.roomstatusTj();
    }

}
